<?php
  $latitude = $vars['latitude'];
  $longitude = $vars['longitude'];
  $container = $vars['container'];
  $markers = $vars['markers'];
  echo elgg_view('map_location/maps/js');
  
?>

<script type="text/javascript">
   //<![CDATA[
    $(document).ready(function() {   
   	// Function added to help reset map and container boundaries
        $("#showMap").click(function() {
        $("#tab2").css({'display':'block'});
        $("#producers_neighbor_map").css({'width':'730px', 'height':'500px'});
        var markers = <?php echo json_encode($markers) ?>;
        var latitude = '<?php echo $latitude ?>';
        var longitude = '<?php echo $longitude ?>';
        var container = '<?php echo $container ?>';
      //put here dublin como default.
        var newyork = new google.maps.LatLng(53.3504168, -6.260683500000027);
        var map = initialize(newyork, markers, container, true);
        //apenas para setar o centro do mapa.
        var latlng = new google.maps.LatLng (latitude, longitude);
        map.setCenter(latlng);
        });       
    });
    //]]>

</script> 


